package stackexchange.posts;

import java.util.Calendar;
import java.util.Vector;

public class Post {
	
	private int postId;
	private Calendar creationDate;
	
	protected int score;
	private String body;
	private int ownedUserId;
	private Calendar lastEditDate;
	private Calendar lastActivityDate;
	private int nComments = 0;
	private boolean edited = false;
	private boolean commented = false;
	private Vector<Integer> editorUserIds = new Vector<Integer>();
	
	public Post(int postId, Calendar creationDate, int score, String body,
			int ownedUserId, Calendar lastEditDate, Calendar lastActivityDate, int nComments) {
		super();
		this.postId = postId;
		this.creationDate = creationDate;
		this.score = score;
		this.body = body;
		this.ownedUserId = ownedUserId;
		this.lastEditDate = lastEditDate;
		this.lastActivityDate = lastActivityDate;
		this.nComments = nComments;
		analyzePost();
	}
	
	public void addEditorUserId(int id){
		editorUserIds.add(id);
	}
	
	public Vector<Integer> getEditorUserIds(){
		return editorUserIds;
	}
	
	private void analyzePost() {
		if(nComments >= 0){
			commented = true;
		}
//		if(lastEditDate > creationDate){
//			edited = true;
//		}		
	}

	public int getPostId() {
		return postId;
	}

	public Calendar getCreationDate() {
		return creationDate;
	}

	public int getScore() {
		return score;
	}

	public String getBody() {
		return body;
	}

	public int getOwnedUserId() {
		return ownedUserId;
	}

	public Calendar getLastEditDate() {
		return lastEditDate;
	}

	public Calendar getGetLastActivityDate() {
		return lastActivityDate;
	}

	public int getnComments() {
		return nComments;
	}

	public boolean isEdited() {
		return edited;
	}

	public boolean isCommented() {
		return commented;
	}

	
	

}
